package com.woniu.controller;

import com.alibaba.fastjson.JSON;
import com.woniu.entity.Emp;
import com.woniu.service.EmpService;
import com.woniu.vo.EmpVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author: 16327
 * @date: 2020/12/26 10:42
 * @description:
 */
@Controller
@RequestMapping("emp")
public class EmpController {
    @Autowired
    EmpService EmpService;
    @RequestMapping("findAll")
    @ResponseBody
    public String findAll1(){
        List<EmpVo> allEmp = EmpService.findAllEmp();
        String s = JSON.toJSONString(allEmp);
        return s;
    }
    @RequestMapping("delEmp/{empid}")
    @ResponseBody
    public String delEmp(@PathVariable("empid") Integer Empid){


        return null;
    }
    @RequestMapping("findEmp/{empid}")
    @ResponseBody
    public String findEmp(@PathVariable("empid") Integer Empid){


        return null;
    }
    @RequestMapping("updateEmp")
    @ResponseBody
    public String updateEmp(@RequestBody Emp Emp){


        return null;
    }
    @RequestMapping("findEmpByLike")
    @ResponseBody
    public String findEmpByLike(@RequestBody Emp Emp){


        return null;
    }
}
